import 'package:distribution_mall_flutter/entity/order/list/order_list_entity.dart';
import 'package:distribution_mall_flutter/pages/order/order_list/widgets/content_card.dart';
import 'package:distribution_mall_flutter/provider/order/order_list.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class OrderListContent extends ConsumerWidget {
  final ScrollPhysics physics;
  const OrderListContent({super.key, required this.physics});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    List<Item> list =
        ref.watch(orderListProvider.select((value) => value.list));
    return ListView.builder(
      physics: physics,
      itemCount: list.length,
      itemBuilder: (BuildContext context, int index) {
        return ContentCard(data: list[index]);
      },
    );
  }
}
